//
//  LLExcelVc.m
//  106Lottery
//
//  Created by MrLee on 2017/7/10.
//  Copyright © 2017年 刘元富. All rights reserved.
//

#import "LLExcelVc.h"
#import "LLExcelInfoVc.h"


@interface LLExcelVc ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)NSArray *titleArr;
@property(nonatomic,strong)NSArray *dataArr;

@end

@implementation LLExcelVc

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initUI];
}

-(void)initUI
{
    [self.navigationItem setTitle:@"图表趋势"];
    
    _titleArr = @[@"双色球",@"大乐透",@"排列三",@"排列五",@"福彩3D",@"山东11选5",@"时时彩",@"块3"];
    _dataArr = @[@[@"红一区走势",@"红二区走势",@"红三区走势",@"蓝一区走势",@"蓝二区走势"],@[@"前一区走势",@"前二区走势",@"前三区走势",@"后区走势"],@[@"基本走势",@"百位新旧码走势",@"十位新旧码走势",@"个位新旧码走势",@"和值走势"],@[@"万位走势",@"千位走势",@"百位走势",@"十位走势",@"个位走势"],@[@"基本走势",@"百位新旧码走势",@"十位新旧码走势",@"个位新旧码走势",@"和值走势"],@[@"基本走势",@"第一位走势",@"第二位走势",@"第三位走势",@"第四位走势",@"第五位走势"],@[@"五星万位走势",@"五星千位走势",@"五星百位走势",@"五星十位走势",@"五星个位走势"],@[@"基本走势",@"和值走势",@"码号形态"]];

}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

    return _titleArr.count;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return  [_dataArr[section] count];
}

-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{


    UILabel *type = [[UILabel alloc]init];
    
    type.frame = CGRectMake(0, 0, DEF_DEVICE_WIDTH, 30);
    type.backgroundColor = [UIColor colorWithPatternImage:[[UIColor UIColorFromRGB:0xFFE2D7 alpha:1] colorTransformToImage]];
    type.textColor = [UIColor darkGrayColor];
    type.text = [NSString stringWithFormat:@"    %@",_titleArr[section]];
    
    [MXUtility topLayerborder:type borderColor:DEF_COLOR_F0F0F0];
    [MXUtility bottomLayerborder:type borderColor:DEF_COLOR_F0F0F0];
    
    return type;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 30;
}


-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    static NSString *TableSampleIdentifier = @"TableSampleIdentifier";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
                             TableSampleIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]
                initWithStyle:UITableViewCellStyleDefault
                reuseIdentifier:TableSampleIdentifier];
    }
    cell.textLabel.text = _dataArr[indexPath.section][indexPath.row];
    cell.textLabel.font = [UIFont systemFontOfSize:15.f];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
    
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    LLExcelInfoVc *vc = [[LLExcelInfoVc alloc]init];
    vc.titleStr = _dataArr[indexPath.section][indexPath.row];
    if (indexPath.section == 0 && indexPath.row ==0) { //大乐透
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=10&type=1";
    }else if (indexPath.section == 0 && indexPath.row ==1){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=10&type=2";
    }else if (indexPath.section == 0 && indexPath.row ==2){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=10&type=3";
    }else if (indexPath.section == 0 && indexPath.row ==3){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=10&type=4";
    }else if (indexPath.section == 0 && indexPath.row ==4){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=10&type=5";
    }else if (indexPath.section == 1 && indexPath.row ==0){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=20&type=1";
        
    }else if (indexPath.section == 1 && indexPath.row ==1){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=20&type=2";
        
    }else if (indexPath.section == 1 && indexPath.row ==2){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=20&type=3";
        
    }else if (indexPath.section == 1 && indexPath.row ==3){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=20&type=4";
        
    }else if (indexPath.section == 2 && indexPath.row ==0){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=26&type=1";
        
    }else if (indexPath.section == 2 && indexPath.row ==1){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=26&type=2";
        
    }else if (indexPath.section == 2 && indexPath.row ==2){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=26&type=3";
        
    }else if (indexPath.section == 2 && indexPath.row ==3){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=26&type=4";
        
    }else if (indexPath.section == 2 && indexPath.row ==4){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=26&type=8";
        
    }else if (indexPath.section == 3 && indexPath.row ==0){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=27&type=1";
        
    }else if (indexPath.section == 3 && indexPath.row ==1){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=27&type=2";
        
    }else if (indexPath.section == 3 && indexPath.row ==2){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=27&type=3";
        
    }else if (indexPath.section == 3 && indexPath.row ==3){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=27&type=4";
        
    }else if (indexPath.section == 3 && indexPath.row ==4){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=27&type=5";
        
    }else if (indexPath.section == 4 && indexPath.row ==0){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=44&type=1";
        
    }else if (indexPath.section == 4 && indexPath.row ==1){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=44&type=2";
        
    }else if (indexPath.section == 4 && indexPath.row ==2){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=44&type=3";
        
    }else if (indexPath.section == 4 && indexPath.row ==3){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=44&type=4";
        
    }else if (indexPath.section == 4 && indexPath.row ==4){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=44&type=8";
        
    }else if (indexPath.section == 5 && indexPath.row ==0){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=115&type=1";
        
    }else if (indexPath.section == 5 && indexPath.row ==1){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=115&type=4";
        
    }else if (indexPath.section == 5 && indexPath.row ==2){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=115&type=5";
        
    }else if (indexPath.section == 5 && indexPath.row ==3){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=115&type=6";
        
    }else if (indexPath.section == 5 && indexPath.row ==4){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=115&type=7";
        
    }else if (indexPath.section == 5 && indexPath.row ==5){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=115&type=8";
        
    }else if (indexPath.section == 6 && indexPath.row ==0){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=120&type=1";
        
    }else if (indexPath.section == 6 && indexPath.row ==1){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=120&type=2";
        
    }else if (indexPath.section == 6 && indexPath.row ==2){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=120&type=3";
        
    }else if (indexPath.section == 6 && indexPath.row ==3){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=120&type=4";
        
    }else if (indexPath.section == 6 && indexPath.row ==4){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=120&type=5";
        
    }else if (indexPath.section == 7 && indexPath.row ==0){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=123&type=1";
        
    }else if (indexPath.section == 7 && indexPath.row ==1){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=123&type=2";
        
    }else if (indexPath.section == 7 && indexPath.row ==2){
        vc.htmlUrl = @"http://client.310win.com/aspx/Chart.aspx?typeid=123&type=3";
        
    }

    [self.navigationController pushViewController:vc animated:YES];

}

@end
